{% extends "usercenter/base.html" %}
{% block content %}
  <div class="col-md-2">&nbsp;</div>
  <div class="col-md-8">
    <div class="hidden-xs alert alert-success text-center">
      <h3 style="font-weight:100;">修改密码</h3>
    </div>
    {% if success %}
      <div class="alert alert-info fade in" role="alert">
        <button class="close" data-dismiss="alert" type="button">
          <span aria-hidden="true">x</span>
          <span class="sr-only">Close</span>
        </button>
        <span>修改成功!</span>
      </div>
    {% endif %}
    <div class="well">
      <form action="." class="form-horizontal" method="post" role="form">{% csrf_token %}
        {% for field in form %}
          <div class="form-group {% if field.errors %} has-error{% endif %}">
            <label class="share-label col-sm-2" for="{{field.id_for_label}}">{{field.label|force_escape}}</label>
            <div class="col-sm-10">
              {% if forloop.first %}
                <input autofocus="" class="form-control" name="{{field.html_name}}" type="password"/>
              {% else %}
                <input class="form-control" name="{{field.html_name}}" type="password"/>{% endif %}
              {% if field.errors %}
                <span class="help-block">{{field.errors.as_text|force_escape}}</span>
              {% endif %}
            </div>
          </div>
        {% endfor %}
        <button class="btn btn-large btn-primary btn-block" type="submit">提交</button>
      </form>
    </div>
  </div>
  <div class="col-md-2">&nbsp;</div>
{% endblock %}
